Skip to content

feat: add static backends (Github, GitLab, and HTTP)#5602

Merged
jdx merged 1 commit into
mainfrom
static
Jul 13, 2025
Merged

feat: add static backends (Github, GitLab, and HTTP)#5602
jdx merged 1 commit into
mainfrom
static

Conversation

@jdx

@jdx jdx commented Jul 12, 2025

Copy link
Copy Markdown
Owner

No description provided.

@jdx jdx changed the title static feat: static backends Jul 12, 2025
@github-actions

github-actions Bot commented Jul 12, 2025

Copy link
Copy Markdown

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.7.4 x -- echo 17.3 ± 0.5 16.7 22.1 1.00
mise x -- echo 17.5 ± 0.5 16.7 19.1 1.01 ± 0.04

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.7.4 env 16.5 ± 0.2 16.2 18.7 1.00
mise env 16.9 ± 0.5 16.3 23.0 1.02 ± 0.03

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.7.4 hook-env 16.7 ± 0.2 16.2 17.7 1.00
mise hook-env 16.7 ± 0.3 16.2 17.8 1.00 ± 0.02

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.7.4 ls 15.0 ± 0.4 14.4 18.3 1.00
mise ls 15.0 ± 0.2 14.5 15.9 1.00 ± 0.03

xtasks/test/perf

Command mise-2025.7.4 mise Variance
install (uncached) 757ms ⚠️ 1090ms -30%
install (cached) 121ms 123ms -1%
ls (uncached) 690ms 690ms +0%
ls (cached) 78ms 77ms +1%
bin-paths (uncached) 697ms ⚠️ 1011ms -31%
bin-paths (cached) 63ms 63ms +0%
task-ls (uncached) 3283ms 3514ms -6%
task-ls (cached) 253ms 252ms +0%

⚠️ Warning: install uncached performance variance is -30%
⚠️ Warning: bin-paths uncached performance variance is -31%

@jdx jdx force-pushed the static branch 3 times, most recently from 325f000 to 768dd83 Compare July 12, 2025 22:57
@jdx jdx changed the title feat: static backends feat: add static backends (Github, GitLab, and HTTP) Jul 12, 2025
@jdx jdx requested a review from Copilot July 12, 2025 22:59
@jdx jdx marked this pull request as ready for review July 12, 2025 22:59

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@jdx jdx force-pushed the static branch 2 times, most recently from fe73690 to 8330de1 Compare July 12, 2025 23:39
@jdx jdx requested a review from Copilot July 12, 2025 23:39

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@jdx jdx force-pushed the static branch 2 times, most recently from b811b73 to 8712e32 Compare July 13, 2025 00:09
@jdx jdx requested a review from Copilot July 13, 2025 00:12

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@jdx jdx requested a review from Copilot July 13, 2025 00:23

This comment was marked as outdated.

@jdx jdx requested a review from Copilot July 13, 2025 00:25

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@jdx jdx requested a review from Copilot July 13, 2025 01:09

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@jdx jdx requested a review from Copilot July 13, 2025 01:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for static backends—GitHub, GitLab, and HTTP—along with platform alias resolution and raw file handling in the archive utilities.

  • Introduces HttpBackend and UnifiedGitBackend implementations with installation, verification, and extraction logic
  • Extends TarFormat with a Raw variant and updates extraction flow
  • Adds platform alias utilities and registers new backends in mod.rs
  • Includes e2e tests and documentation for HTTP, GitHub, and GitLab backends

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/file.rs Added Raw variant, updated from_ext, and modified open_tar
src/backend/ubi.rs Added clarifying comment for bin_path lookup
src/backend/platform.rs New platform alias and lookup helpers
src/backend/mod.rs Registered GitHub, GitLab, HTTP backends and added env var
src/backend/http.rs Implemented HTTP backend with download, verify, and install
src/backend/github.rs Implemented unified GitHub/GitLab backend logic
src/backend/backend_type.rs Added Github, Gitlab, and Http backend types
e2e/backend/test_http End-to-end tests for HTTP backend
e2e/backend/test_gitlab End-to-end tests for GitLab backend
e2e/backend/test_github End-to-end tests for GitHub backend
docs/dev-tools/mise-lock.md New lockfile documentation
docs/dev-tools/backends/ubi.md Added binary path lookup order
docs/dev-tools/backends/index.md Listed new backends in index
docs/dev-tools/backends/http.md Documentation for HTTP backend
docs/dev-tools/backends/gitlab.md Documentation for GitLab backend
docs/dev-tools/backends/github.md Documentation for GitHub backend
docs/.vitepress/config.ts Updated sidebar to include new docs
Comments suppressed due to low confidence (3)

docs/dev-tools/backends/http.md:47

  • Key names in docs use platforms_*_url but code expects platform_{os}_{arch}_url (singular platform_). Update examples to match implementation.
platforms_macos_x64_url = "https://example.com/releases/my-tool-v1.0.0-macos-x64.tar.gz"

docs/dev-tools/backends/http.md:75

  • Checksum examples use platforms_*_checksum but code looks for platform_{os}_{arch}_checksum. Align docs key naming with code.
platforms_macos_x64_checksum = "sha256:a1b2c3d4e5f6789..."

src/file.rs:652

  • There are no unit tests covering TarFormat::from_ext, especially for .tar and unknown extensions. Consider adding tests to verify Raw and other mappings.
    pub fn from_ext(ext: &str) -> Self {

Comment thread src/file.rs
Ok(match format {
TarFormat::TarGz => Box::new(GzDecoder::new(f)),
// TODO: we probably shouldn't assume raw is tar.gz, but this was to retain existing behavior
TarFormat::TarGz | TarFormat::Raw => Box::new(GzDecoder::new(f)),

Copilot AI Jul 13, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Treating Raw as gzipped tar in open_tar is misleading; for Raw, return the file reader directly (e.g., Box::new(f)) instead of wrapping in GzDecoder.

Suggested change
TarFormat::TarGz | TarFormat::Raw => Box::new(GzDecoder::new(f)),
TarFormat::TarGz => Box::new(GzDecoder::new(f)),
TarFormat::Raw => Box::new(f),

Copilot uses AI. Check for mistakes.
Comment thread src/file.rs
"gz" | "tgz" => TarFormat::TarGz,
"xz" | "txz" => TarFormat::TarXz,
"bz2" | "tbz2" => TarFormat::TarBz2,
"zst" | "tzst" => TarFormat::TarZst,

Copilot AI Jul 13, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .tar extension is not explicitly handled and falls back to Raw, causing tar archives not to be extracted. Consider adding a case for "tar" or supporting uncompressed tars.

Suggested change
"zst" | "tzst" => TarFormat::TarZst,
"zst" | "tzst" => TarFormat::TarZst,
"tar" => TarFormat::Tar,

Copilot uses AI. Check for mistakes.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Tar Format Mismatch Causes Decompression Failures

The from_ext function now defaults to TarFormat::Raw for unknown file extensions. However, open_tar incorrectly treats TarFormat::Raw identically to TarFormat::TarGz, applying gzip decompression. This mismatch causes files with unknown extensions (classified as Raw) to be processed as gzipped tar files, leading to decompression failures for non-compressed or non-gzipped files. This regression affects code paths using TarFormat::Auto on unknown extensions, breaking the previous fallback to tar.gz.

src/file.rs#L653-L662

mise/src/file.rs

Lines 653 to 662 in bc805ff

match ext {
"gz" | "tgz" => TarFormat::TarGz,
"xz" | "txz" => TarFormat::TarXz,
"bz2" | "tbz2" => TarFormat::TarBz2,
"zst" | "tzst" => TarFormat::TarZst,
"zip" => TarFormat::Zip,
_ => TarFormat::Raw,
}
}
}

src/file.rs#L745-L747

mise/src/file.rs

Lines 745 to 747 in bc805ff

Ok(match format {
// TODO: we probably shouldn't assume raw is tar.gz, but this was to retain existing behavior
TarFormat::TarGz | TarFormat::Raw => Box::new(GzDecoder::new(f)),

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@jdx jdx merged commit 581eae0 into main Jul 13, 2025
@jdx jdx deleted the static branch July 13, 2025 01:58
This was referenced Jul 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants